#include "dbl_link_list.h"
#include "platform_wrappers.h"

dbl_list_t *create_dbl_list()
{
    dbl_list_t *sentinel = MEM_ALLOC(sizeof(dbl_list_t));
    sentinel->next = sentinel->prev = sentinel;
    sentinel->node_type.count = 0;
    return sentinel;
}


void delete_dbl_list(dbl_list_t *sentinel)
{
    while (sentinel->next != sentinel) {
            dbl_list_t *temp = sentinel->next;
            sentinel->next = temp->next;
            MEM_FREE(temp);
    }

    MEM_FREE(sentinel);

    return;
}
